//
//  MainTabBarController.swift
//  Swift2048
//
//  Created by LiynXu on 2016/9/27.
//  Copyright © 2016年 LiynXu. All rights reserved.
//

import UIKit

class MainTabBarController: UITabBarController {
    let mainNaviController:UINavigationController = {
        var vc = MainViewController()
        vc.title = "2048"
        
        let color:[CGFloat] = [0.266666666666667,0.843137254901961,0.658823529411765]
        vc.view.backgroundColor = UIColor.init(red: color[0], green: color[1], blue: color[2], alpha: 1)
        let navi = UINavigationController(rootViewController: vc)
        return navi
    }()
    let settingNaviController:UINavigationController = {
        let vc = SettingViewController()
        vc.title = "设置"
        let navi = UINavigationController(rootViewController: vc)
        return navi
    }()
    let bgColorNaviController:UINavigationController = {
        let vc = BGColorViewController()
        vc.title = "背景颜色"
        
        let navi = UINavigationController(rootViewController: vc)
        return navi
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
//        self.childViewControllers = [mainViewController,settingViewController,bgColorviewController]
        
        self.addChildViewController(mainNaviController)
        self.addChildViewController(settingNaviController)
        self.addChildViewController(bgColorNaviController)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
